extends layout

block content
	div.container
		ul.nav
			li.active
				a(href='/home') Homeworks
			li 
				if user.identity == 'student'
					a(href='/submits') Your Submits
				else if user.identity == 'teacher'
					a(href='/submits') All Submits
			li
				if user.identity == 'student'
					a(href='/new') Submit new homework
				else if user.identity == 'teacher'
					a(href='/new') Publish new homework
			li 
				a(href='/signout') Signout
		hr

		div.container
			if homeworks.length == 0
				p &nbsp;&nbsp;none.
			else
				each item in homeworks
					div.row
						p <strong> &nbsp;Homework: #{item.name} </strong> 
						div.describe #{item.description}
						p Start at: #{item.start} &nbsp; Deadline: #{item.ddl}
							if user.identity == 'student' && item.ddl >=current
								a(class='btn btn-ty', type='button' disabled='disabled') Available 
						if user.identity == 'teacher' && item.ddl >= current
							form(action='/edit/#{item.name}', method='GET')
								button(class='btn btn-sm btn-primary', type='submit') Edit
					br 
					br